package musictube.client;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Hidden iFrame song player.
 * 
 * @author Russell Souza
 */
public class HiddenIFrameSongPlayer extends VerticalPanel {

	/**
	 * Placeholder for the iFrame.
	 */
	private HTML m_iFrame;

	/**
	 * Constructor.
	 */
	public HiddenIFrameSongPlayer() {

		// create the iFrame placeholder
		m_iFrame = new HTML();
		add(m_iFrame);
	}

	/**
	 * Set the song to play.
	 * 
	 * @param p_location the song location (full web address)
	 */
	public void setSong(String p_location) {
		String iFrameText = "<iframe width='0px' height='0px' src=\""
				+ p_location + "\" />";
		m_iFrame.setHTML(iFrameText);
	}
}
